﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EmployeeSystem.Models
{
    /// <summary>
    /// 合同
    /// </summary>
    public class Contract
    {
        /// <summary>
        /// 合同ID
        /// </summary>
        public Guid Id { get; set; }

        /// <summary>
        /// 薪资
        /// </summary>
        [Display(Name = "薪资")]
        [Range(0, int.MaxValue, ErrorMessage = "薪资必须大于0")]
        public decimal Salary { get; set; }

        /// <summary>
        /// 生效时间
        /// </summary>
        public DateTime EffectiveDate { get; set; }

        /// <summary>
        /// 到期时间
        /// </summary>
        public DateTime ExpirationDate { get; set; }

        /// <summary>
        /// 默认时间
        /// </summary>
        private readonly DateTime defaultTime = new DateTime(2000, 1, 1);


        public Contract()
        {
            EffectiveDate = defaultTime;
            ExpirationDate = defaultTime;
        }
    }

    
}
